package com.by.service.impl;

import com.by.bean.SupplierInquiry;
import com.by.bean.SupplierQuotation;
import com.by.common.bean.PageBean;
import com.by.common.crud.BaseServiceImpl;
import com.by.mapper.SupplierInquiryMapper;
import com.by.mapper.SupplierQuotationMapper;
import com.by.query.SupplierQuotationQuery;
import com.by.service.SupplierInquiryService;
import com.by.service.SupplierQuotationService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public class SupplierQuotationServiceImpl extends BaseServiceImpl<SupplierQuotation, SupplierQuotationMapper> implements SupplierQuotationService {

    @Autowired
    SupplierQuotationMapper supplierQuotation;
    @Override
    public PageBean query(SupplierQuotationQuery supplierQuotation) {
        PageHelper.startPage(supplierQuotation.getPage(), supplierQuotation.getPageSize());//后面紧跟查询
        List list = baseMapper.query(supplierQuotation);
        System.out.println(list);
        PageInfo info = new PageInfo(list);
        return new PageBean(supplierQuotation.getPage(), supplierQuotation.getPageSize(), info.getTotal(), list);
    }
}
